package ae.pcfc.etks.online.common.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * UserStatusHistory entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_USER_STATUS_HISTORY", schema = "ETKS_ONLINE_DBA")
@SequenceGenerator(name = "SQ_ETKS_USER_STATUS_HISTORY", sequenceName = "SQ_ETKS_USER_STATUS_HISTORY", allocationSize = 1, initialValue = 1)
public class UserStatusHistory implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 8149918547418192115L;
	private Long usHistoryId;
	private User User;
	private String usHistoryAction;
	private String usHistoryActionComments;
	private String usHistoryActionBy;
	private Date usHistoryCreateDate;

	// Constructors

	/** default constructor */
	public UserStatusHistory() {
	}

	/** full constructor */
	public UserStatusHistory(User User, String usHistoryAction,
			String usHistoryActionComments, String usHistoryActionBy) {
		this.User = User;
		this.usHistoryAction = usHistoryAction;
		this.usHistoryActionComments = usHistoryActionComments;
		this.usHistoryActionBy = usHistoryActionBy;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_ETKS_USER_STATUS_HISTORY" )
	@Column(name = "US_HISTORY_ID", nullable = false, precision = 11, scale = 0)
	public Long getUsHistoryId() {
		return this.usHistoryId;
	}

	public void setUsHistoryId(Long usHistoryId) {
		this.usHistoryId = usHistoryId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.User;
	}

	public void setUser(User User) {
		this.User = User;
	}

	@Column(name = "US_HISTORY_ACTION", length = 10)
	public String getUsHistoryAction() {
		return this.usHistoryAction;
	}

	public void setUsHistoryAction(String usHistoryAction) {
		this.usHistoryAction = usHistoryAction;
	}

	@Column(name = "US_HISTORY_ACTION_COMMENTS", length = 100)
	public String getUsHistoryActionComments() {
		return this.usHistoryActionComments;
	}

	public void setUsHistoryActionComments(String usHistoryActionComments) {
		this.usHistoryActionComments = usHistoryActionComments;
	}

	@Column(name = "US_HISTORY_ACTION_BY", length = 50)
	public String getUsHistoryActionBy() {
		return this.usHistoryActionBy;
	}

	public void setUsHistoryActionBy(String usHistoryActionBy) {
		this.usHistoryActionBy = usHistoryActionBy;
	}
	
	@Temporal(TemporalType.DATE)
	@Column(name = "US_HISTORY_CREATE_DATE", nullable = false)
	public Date getUsHistoryCreateDate() {
		return usHistoryCreateDate;
	}

	public void setUsHistoryCreateDate(Date usHistoryCreateDate) {
		this.usHistoryCreateDate = usHistoryCreateDate;
	}	
}